<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
	<head>
		<title>公会列表</title>
		<base href="<%=basePath%>" />
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<meta name="apple-mobile-web-app-title" content="Amaze UI" />
		<link rel="stylesheet" href="layui/css/layui.css" media="all"> <!-- 适应所有设备 -->
		<style type="text/css">
		</style>
	</head>
	<% String nowDay = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); %>
	<body>
	
	    <form class="layui-form" onsubmit='return false'>
	      <br/>
	    <table class="layui-hide" id="exchangeNumber" lay-filter="exchangeNumber"></table>
	    </form>
	    
	    <script src="js/jquery.min.js"></script>
		<script src="layui/layui.js"></script>
		<script>
		    layui.use(['layer','form','table'],function(){
		    	var layer = layui.layer,
		    	    form  = layui.form,
		    	    table = layui.table;
		    	
		    	layer.config({
					extend: 'MySkin/style.css'
				});
		    	
		    	
		    	table.render({
		    		elem:'#exchangeNumber',
		    		method:'post',
		    		url:'agent/ExchangeNumber',
		    		title:'代理等级和信息',
		    		skin: 'row',
		    		even: true,
		    		page : true,//分页
		    		autoSort: false,
		    		id:'AllTable',
		    		request:{
						pageName:'PageIndex',
						limitName:'PageCount'
					},
		    		cols:[[
		    			{field:'WarheadCount',title:'自动兑换弹头总数',style:'color:#d71345'},
		    			{field:'DayString',title:'开服到指定日期',style:'color:#f47920'},
		    			]],
		    			response:{
							statusCode : 200
						},
						parseData:function(res){
							return{
								"code":res.status,
								"msg":res.message,
								"count":res.count,
								"data":res.data
							};
						}
		    	});
		    	
		    	
		    	/* table.render({
		    		elem:'#Agent',
		    		method:'post',
		    		title:'一级代理信息',
		    		skin: 'row',
		    		even: true,
		    		page : true,//分页
		    		autoSort: false,
		    		id:'AllTable',
		    		request:{
						pageName:'PageIndex',
						limitName:'PageCount'
					},
		    		cols:[[
		    			{field:'UserId',title:'ID',style:'color:#d71345'},
		    			{field:'Nickname',title:'昵称',style:'color:#f47920'},
		    			{field:'SubUserCount',title:'旗下2级代理数量',style:'color:#f05b72'},
		    			{field:'Assets',title:'当前总贡献',style:'color:#1d953f'},
		    			{field:'TotalAssets',title:'旗下代理总贡献',style:'color:#009ad6'},
		    			{field:'TotalWarheadCount',title:'总兑换弹头',style:'color:#5c7a29'}
		    			]],
						response : {
							statusCode : 200
						//重新规定成功的状态码为 200，table 组件默认为 0
						},
						data:data.data
		    	}); */
		    	
		    	
		    	
		    	//定时刷新数据
				setInterval(function(){
					table.reload('AllTable', {
						page: {
							curr: 1 //重新从第 1 页开始
						}
						//根据条件查询
						,
						where: {
							DisplayType:$("#DispalyLevel").val()
						}
					});
	              },300000);
		    	
	          	});
		</script>
    </body>
</html>